package me.zhengjie.poemQuestions.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.poemQuestions.domain.enums.QuestionType;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 诗词题目实体类
 * @author yellow
 * @date 2025-04-23
 */
@Data
//@EqualsAndHashCode(callSuper = false)
//@Accessors(chain = true)
@TableName("poem_questions")
@ApiModel(value="PoemQuestions对象", description="诗词题目信息")
public class PoemQuestions implements  Serializable {

    @ApiModelProperty(value = "题目ID")
    @TableId(value = "question_id", type = IdType.AUTO)
    private Integer questionId;

    @ApiModelProperty(value = "问题内容")
    private String question;

    @ApiModelProperty(value = "选项A")
    private String optionA;

    @ApiModelProperty(value = "选项B")
    private String optionB;

    @ApiModelProperty(value = "选项C")
    private String optionC;

    @ApiModelProperty(value = "选项D")
    private String optionD;

    @ApiModelProperty(value = "正确答案")
    private String correctAnswer;

    @ApiModelProperty(value = "题目来源")
    private String source;

    @ApiModelProperty(value = "难度级别")
    private Integer difficulty;

    @ApiModelProperty(value = "题目分类")
    private String category;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updatedAt;

    @ApiModelProperty(value = "题目类型")
    private QuestionType type;

    public void copy(PoemQuestions source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}